package com.cxx.purchasecharge.core.model.persistence;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.cxx.purchasecharge.core.model.BaseModel;

/**
 * 货物仓库
 */
@Entity
@Table (name = "pc_goods_depository")
public class GoodsDepository extends BaseModel
{
    private static final long serialVersionUID = 1L;
    
    private long id;
    private String name;
    private String location;
    private String otherInfo;
    
    private List<Goods> goodses;
    
    public GoodsDepository () {}

    @Id
    @GeneratedValue (strategy = GenerationType.AUTO)
    public long getId ()
    {
        return id;
    }

    public void setId (long id)
    {
        this.id = id;
    }

    @Column (nullable = false, unique = true)
    public String getName ()
    {
        return name;
    }

    public void setName (String name)
    {
        this.name = name;
    }

    public String getLocation ()
    {
        return location;
    }

    public void setLocation (String location)
    {
        this.location = location;
    }

    @Column (length = 1024)
    public String getOtherInfo ()
    {
        return otherInfo;
    }

    public void setOtherInfo (String otherInfo)
    {
        this.otherInfo = otherInfo;
    }

    @OneToMany (mappedBy = "depository")
    public List <Goods> getGoodses ()
    {
        return goodses;
    }

    public void setGoodses (List <Goods> goodses)
    {
        this.goodses = goodses;
    }
}
